CC = g++
CCFLAGS = -g -Wall
LDFLAGS = -lm -lpthread -lactivemq-cpp -lprotobuf	
INCLUDES=-I/usr/local/include/activemq-cpp-3.6.0 -I. -I/usr/local/apr/include -I/usr/include
OBJDIR=../obj
SRCDIR=src
HDRS=$(wildcard *.h)
SRC=$(wildcard *.cc)
SRCPATH=$(addprefix $(SRCDIR), $(SRC))
OBJ=$(SRC:.cc=.o)
OBJPATH=$(addprefix $(OBJDIR)/, $(OBJ))
TARGET=testProducer
 
.cc.o:
	@echo $(SRC) 
	mkdir -p $(OBJDIR)
	$(CC)  -o $(OBJDIR)/$@ $(INCLUDES) $(CCFLAGS) -c $< 

$(TARGET): main.o prmMQlib.o exServer.pb.o $(HDRS)
	$(CC) -o $@ $(INCLUDES) $(OBJPATH) $(LDFLAGS)
	
clean:
	rm -rf $(OBJDIR) $(TARGET)
